package com.kedeng.yangmuyi.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * common util method for KD project.
 * 
 * @author: rqian
 * @version: 1.0, Nov 20, 2013
 */

public class KDCommonUtils {

    /**
     * 
     * check email's formattor.
     * 
     * @param email
     * @return
     */
    public static boolean validateEmailFormat(String email) {
        String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        Pattern regex = Pattern.compile(check);
        Matcher matcher = regex.matcher(email);
        return matcher.matches();
    }
}
